package com.lwf.smartseniorcare.repository;

import com.lwf.smartseniorcare.entity.Elderly;
import com.lwf.smartseniorcare.entity.HealthRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface HealthRecordRepository extends JpaRepository<HealthRecord, Long> {
    List<HealthRecord> findByElderlyOrderByRecordDateDesc(Elderly elderly);
    List<HealthRecord> findByElderlyAndRecordDateBetween(Elderly elderly, Date startDate, Date endDate);
    List<HealthRecord> findTop10ByElderlyOrderByRecordDateDesc(Elderly elderly);
}
